## [1] "2024-03-14 UTC" "2024-06-10 UTC"
## [1] 11503
## # A tibble: 1 × 7
## min max mean q1 median q3 sd
## <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 7 913 134. 73 100. 147. 125.
##### Doprinos riječi sentimentu (NRC)
## [1] "Most Frequent Co-occurrences:"
## [1] "Most Correlated Words:"
# Count word occurrences by date
word_counts_time <- tidy_text %>%
count(date, word) %>%
complete(date, word, fill = list(n = 0)) # Fill missing dates with zeroes
# Calculate time correlation of word frequencies
time_correlations <- word_counts_time %>%
pairwise_cor(word, date, n, sort = TRUE)
# Display time correlations
print("Time Correlations between Target Words:")
print(time_correlations)
# Optional: Plot time trends of words
word_counts_time %>%
ggplot(aes(x = date, y = n, color = word)) +
geom_line() +
labs(title = "Word Frequency Over Time", x = "Date", y = "Frequency") +
theme_minimal()